package com.example.demo.design.template_method;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 22:33 2020/11/11
 * @Modified By:
 */
public class Test {
    public static void main(String[] args) {
        // 大方请客,不加修改的继承了抽线父类的模板方法
        Treat generousTreat = new GenerousTreat();
        // 调用模板方法时候，使用该类的eat()方法
        generousTreat.treat();
        System.out.println("*****");
        Treat stingyTreat = new StingyTreat();
        stingyTreat.treat();
    }
}
